package com.easylinkin.linkappapi.jzsmokewarning.entity;

import com.easylinkin.linkappapi.common.utils.DateUtil;
import lombok.Data;

/**
 * 表格导出
 */
@Data
public class SmokeWarningVo extends SmokeWarning {
    /**
     * 时间范围
     */
    private String range;

    private String createTimeStr;

    public SmokeWarningVo(SmokeWarning smokeWarning) {
        this.setDeviceCode(smokeWarning.getDeviceCode());
        this.setDeviceName(smokeWarning.getDeviceName());
        this.setAreaPath(smokeWarning.getAreaPath());
        this.setCycle(smokeWarning.getCycle());
        this.setDataCount(smokeWarning.getDataCount());
        this.setAverageValue(smokeWarning.getAverageValue());
        this.setAttribute(smokeWarning.getAttribute());
        this.createTimeStr = smokeWarning.getCreateTime() != null ? DateUtil.getYYYYMMDDHHMMSSDate(smokeWarning.getCreateTime()) : null;
        this.range = DateUtil.getYYYYMMDDHHMMSSDate(smokeWarning.getStartTime()) + "-" + DateUtil.getYYYYMMDDHHMMSSDate(smokeWarning.getEndTime());
    }


}
